﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<OneDollarStore.App_Data.Product>" %>
<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm())
   {%>
<%= Html.ValidationSummary(true) %>
<table>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.ProductID) %>
        </td>
        <td>
            <%= Html.Encode(Model.ProductID) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Name) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.Name) %>
            <%= Html.ValidationMessageFor(model => model.Name) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Category) %>
        </td>
        <td>
            <%= Html.DropDownList("CategoryID", new SelectList(ViewData["Categories"] as IEnumerable,
    "CategoryID", "Name", Model.Category.CategoryID))%>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Manufacturer) %>
        </td>
        <td>
            <%= Html.DropDownList("ManufacturerID", new SelectList(ViewData["Manufacturers"] as IEnumerable,
    "ManufacturerID", "Name", Model.Manufacturer.ManufacturerID))%>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Price) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.Price, String.Format("{0:F}", Model.Price)) %>
            <%= Html.ValidationMessageFor(model => model.Price) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Promotion) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.Promotion) %>
            <%= Html.ValidationMessageFor(model => model.Promotion) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.CPU) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.CPU) %>
            <%= Html.ValidationMessageFor(model => model.CPU) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.MainBoard) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.MainBoard) %>
            <%= Html.ValidationMessageFor(model => model.MainBoard) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.RAM) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.RAM) %>
            <%= Html.ValidationMessageFor(model => model.RAM) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.OS) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.OS) %>
            <%= Html.ValidationMessageFor(model => model.OS) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Graphics) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.Graphics) %>
            <%= Html.ValidationMessageFor(model => model.Graphics) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.ScreenSize) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.ScreenSize) %>
            <%= Html.ValidationMessageFor(model => model.ScreenSize) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.CDDVD) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.CDDVD) %>
            <%= Html.ValidationMessageFor(model => model.CDDVD) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.HardDisk) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model => model.HardDisk) %>
            <%= Html.ValidationMessageFor(model => model.HardDisk) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Highlight) %>
        </td>
        <td>
            <%= Html.CheckBoxFor(model => model.Highlight) %>
            <%= Html.ValidationMessageFor(model => model.Highlight) %>
        </td>
    </tr>
    <tr>
        <td>
            <%= Html.LabelFor(model => model.Picture) %>
        </td>
        <td>
            <%= Html.TextBoxFor(model=>model.Picture) %>
            <%= Html.ValidationMessageFor(model=>model.Picture) %>
        </td>
    </tr>
</table>
<% } %>
